<template>
  <div class="h5-navbar">
    <div class="h5-title">{{title}}</div>
    <div class="h5-back" @click="onClickLeft" v-if="leftArrow">
      <van-icon name="arrow-left" size="22px" color="#fff" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'NavBar',
  props: {
    title: {
      type: String,
    },
    onClickLeft: {
      type: Function,
    },
    leftArrow: {
      type: Boolean,
      default() {
        return true;
      },
    },
  },
  data() {
    return {

    };
  },
  methods: {
  },
};
</script>

<style lang="scss" scoped>
.h5-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  z-index: 9;
  .h5-title {
    position: relative;
    color: #fff;
    width: 100%;
    height: 100px;
    line-height: 100px;
    font-size: 32px;
    text-align: center;
    background: #334154;
    border-bottom: 1px solid #eee;
  }
  .h5-back {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 9;
    display: flex;
    align-items: center;
    height: 100px;
    width: 90px;
    .van-icon-arrow-left {
      position: relative;
      left: 20px;
    }
  }
}

</style>
